// 品牌管理的接口请求函数
import request from '@/utils/http/request';
import type {TrademarkData, TrademarkListData} from './modules/trademarkList';

// GET /admin/product/baseTrademark/{page}/{limit}
// 分页列表
export function reqGetTrademarkList(page: number, limit: number){
    return request.get<any, TrademarkListData>(`/admin/product/baseTrademark/${page}/${limit}`);
}

// 添加或修改的接口请求
// POST /admin/product/baseTrademark/save
// 新增BaseTrademark
// PUT /admin/product/baseTrademark/update
// 修改BaseTrademark
export function reqAddOrUpdateTrademark({id, tmName, logoUrl}: TrademarkData){
    if(id){
        return request.put<any, null>('/admin/product/baseTrademark/update', {
            id, tmName, logoUrl
        });
    }else{
        return request.post<any, null>('/admin/product/baseTrademark/save', {
            tmName,
            logoUrl
        });
    }
}


// DELETE /admin/product/baseTrademark/remove/{id}
// 删除BaseTrademark
export function reqDeleteTrademark(id: number){
    return request.delete<any, null>(`/admin/product/baseTrademark/remove/${id}`)
}


